﻿{include file="public/header"}
<title>订单列表</title>
</head>
<style>
    .layui-layer-page .layui-layer-content {
        overflow: visible !important;
    }
    .row{ height: 20px; overflow: hidden;}
</style>
<body>
<nav class="breadcrumb">
    <i class="Hui-iconfont">&#xe67f;</i> 首页
    <span class="c-gray en">&gt;</span> 订单管理
    <span class="c-gray en">&gt;</span> {$title}
    <a class="label label-success radius r" style="line-height:1.6em;margin-top:3px"
       href="javascript:location.replace(location.href);" title="刷新"><i class="Hui-iconfont">&#xe68f;</i></a>
</nav>
<div class="page-container">
    <form method="get">
        <div class="ch-c">
            <div class="ch-form-row">
                <p>创建时间:</p>
                <input type="text" name="start_time" id="countTimestart" onfocus="selecttime(1)"
                readonly
                value="<?php echo isset($data['start_time'])?$data['start_time']:''?>">
                <b>-</b>
                <input type="text" name="end_time" id="countTimeend" onfocus="selecttime(2)"
                readonly
                value="<?php echo isset($data['end_time'])?$data['end_time']:''?>">
            </div>
            <input type="hidden" name="type" value="{$type}">
            <div class="ch-form-select">
                <select name="chen">
                    <option value="" >搜索名称</option>
		    <option value="contacts">姓名</option>
			{if condition=" $hide ==2"}
                    <option value="telephone">手机号</option>
			{/if}
                    <option value="order_no">订单编号</option>
                    <option value="addres">地址</option>
                </select>
                <input type="text" name="contacts" class="" placeholder="">
            </div>
            
            <input type="text" name="assignor" placeholder="接单人" <?php if($type==0 || $type==10){ ?> style="display: none"<?php }?>class="ch-form-assignor" >

            <button class="btn btn-success" type="submit"><i class="Hui-iconfont">&#xe665;</i> 搜索</button>

        </div>
        <!-- <div class="text-c">
            创建时间:
            <input type="text" name="start_time" id="countTimestart" onfocus="selecttime(1)" size="17"
                   class="date input-text" readonly
                   value="<?php echo isset($data['start_time'])?$data['start_time']:''?>">
            -
            <input type="text" name="end_time" id="countTimeend" onfocus="selecttime(2)" size="17"
                   class="date input-text" readonly
                   value="<?php echo isset($data['end_time'])?$data['end_time']:''?>">
            <span class="select-box inline">
            <input type="hidden" name="type" value="{$type}">
		</span>
            <span class="select-box inline">
		<select name="chen" class="select">
			<option value="" >搜索名称</option>
            <option value="contacts">姓名</option>
            <option value="telephone">手机号</option>
            <option value="order_no">订单编号</option>
            <option value="addres">地址</option>
		</select>

		</span>
            <input type="text" name="contacts" placeholder="" style="width:250px" class="input-text">
            <input type="text" name="assignor" placeholder="接单人" <?php if($type==0 || $type==10){ ?> style="display: none"<?php }?>style="width:250px" class="input-text" >

            <button class="btn btn-success" type="submit"><i class="Hui-iconfont">&#xe665;</i> 搜索</button>
 

        </div> -->

    </form>
    <div class="mt-20">
        <div class="title-border">
            <div class="flex1 screen-phone">ID</div>
            <div class="flex5 screen-phone">订单号</div>
            <div class="flex2 screen-phone">来源</div>
            <div class="flex3">联系人</div>
	    {if condition="$hide == 2"}
            <div class="flex3">联系方式</div>
		{/if}
            <div class="flex8">地址</div>
            <div class="flex3 screen-phone " id="dig">订单状态</div>
            <div class="flex3 screen-phone">下单时间</div>
            <div class="flex2 screen-phone" <?php if($type==0 || $type==10){ ?> style="display: none"<?php }?> >接单人</div>
            <div class="flex2 screen-phone" <?php if($type==0 || $type==10){ ?> style="display: none"<?php }?> >店铺</div>
            <div class="flex6">操作</div>
        </div>
        {volist name='list' id='vo'}
        <div class="content-border">
            <input type="hidden" value="{$vo.state}" class="states">
            <div class="flex1 screen-phone">{$vo.order_id}</div>
            <div class="flex5 screen-phone">{$vo.order_no}</div>
            <div class="flex2 screen-phone">{$vo.title}</div>
            <div class="flex3">{$vo.contacts}</div>
	     {if condition="$hide == 2"}
            <div class="flex3">{$vo.telephone}</div>
            {/if}
            <div class="flex8">{$vo['province'].$vo['city'].$vo['county'].$vo['addres']}</div>
            {if condition="$vo.state == 0 || $vo.state == 1"}
            <div class="flex3 screen-phone">{$vo.states}</div>
            {else}
            <div class="flex3 screen-phone">{if condition="$vo.planned"}{:date('Y-m-d H:i:s',$vo.planned)}{else}暂无{/if}</div>
            {/if}
            <div class="flex3 screen-phone">{:date('Y-m-d H:i:s',$vo.created_time)}</div>
            <div class="flex2 screen-phone" <?php if($type==0 || $type==10){ ?> style="display: none"<?php }?> >{$vo.namekl}</div>
            <div class="flex2 screen-phone" <?php if($type==0 || $type==10){ ?> style="display: none"<?php }?> >{$vo.store_name}</div>
            <div class="flex6 screen-pc">
                <a class="ch-button ch-blue more" data-id="{$vo.order_id}" href="javascript:;" title="查看更多">查看更多</a>
            </div>
            <div class="flex6 screen-phone">
                {if condition="$vo.state == 0"}
                <a class="ch-button ch-green zhi" data-id="{$vo.order_id}" data-key="1" href="javascript:;" title="指派">指派</a>
                <a class="ch-button ch-blue info" data-id="{$vo.order_id}" href="javascript:;" title="查看">查看</a>
                <a class="ch-button ch-gray edit" data-id="{$vo.order_id}" href="javascript:;" title="编辑">编辑</a>
                <a class="ch-button ch-red del" data-id="{$vo.order_id}" href="javascript:;" title="取消">取消</a>

                {/if}
                {if condition="$vo.state == 1"}
                <a class="ch-button ch-green jie" data-id="{$vo.order_id}" href="javascript:;" title="接单提醒">接单提醒</a>
                <a class="ch-button ch-blue info" data-id="{$vo.order_id}" href="javascript:;" title="查看">查看</a>
                <a class="ch-button ch-wathet zhi" data-id="{$vo.order_id}"  data-key="2" href="javascript:;" title="转指派">转指派</a>
                <a class="ch-button ch-gray edit" data-id="{$vo.order_id}" href="javascript:;" title="编辑">编辑</a>
                <a class="ch-button ch-red del" data-id="{$vo.order_id}" href="javascript:;" title="取消">取消</a>


                {/if}
                {if condition="$vo.state == 2"}
                <a class="ch-button ch-green jilie" data-id="{$vo.order_id}" href="javascript:;" title="开始基建">开始基检</a>
                <a class="ch-button ch-wathet zhi" data-id="{$vo.order_id}"  data-key="2" href="javascript:;" title="转指派">转指派</a>
                <a class="ch-button ch-gray edit" data-id="{$vo.order_id}" href="javascript:;" title="编辑">编辑</a>
                <a class="ch-button ch-blue info" data-id="{$vo.order_id}" href="javascript:;" title="查看">查看</a>
                <a class="ch-button ch-red del" data-id="{$vo.order_id}" href="javascript:;" title="取消">取消</a>

                {/if}
                {if condition="$vo.state == 3"}
                <a class="ch-button ch-green que" data-id="{$vo.order_id}" href="javascript:;" title="确认签约">确认签约</a>
                <a class="ch-button ch-wathet zhi" data-id="{$vo.order_id}"  data-key="2"  href="javascript:;" title="转指派">转指派</a>
                <a class="ch-button ch-gray edit" data-id="{$vo.order_id}"  href="javascript:;" title="编辑">编辑</a>
                <a class="ch-button ch-blue info" data-id="{$vo.order_id}" href="javascript:;" title="查看">查看</a>
                <a class="ch-button ch-red del" data-id="{$vo.order_id}" href="javascript:;" title="取消">取消</a>

                {/if}
                <!--{if condition="$vo.state == 4"}-->

                <!--<a class="ch-button ch-wathet she" data-id="{$vo.order_id}" href="javascript:;" title="开始验收">开始验收</a>-->
                <!--<a class="ch-button ch-blue info" data-id="{$vo.order_id}" href="javascript:;" title="查看">查看</a>-->
                <!--<a class="ch-button ch-red tui" data-id="{$vo.order_id}" href="javascript:;" title="退单">退单</a>-->
                <!--&lt;!&ndash;<a style="text-decoration:none" class="ml-5 edit" data-id="{$vo.order_id}"  href="javascript:;" title="编辑"><span class="label label-default">编辑</span></a>&ndash;&gt;-->

                <!--{/if}-->
                {if condition="$vo.state == 5 || $vo.state == 4"}
                <a class="ch-button ch-green yan" data-id="{$vo.order_id}"  href="javascript:;" title="开工设置">开工设置</a>
                {if condition="$vo.yu > 0 " }
                <a class="ch-button ch-green fa" data-id="{$vo.order_id}" href="javascript:;" title="发起验收">发起收款</a>
                {else}
                <a class="ch-button ch-green " data-id="{$vo.order_id}" href="javascript:;" title="发起验收">已结清</a>
                {/if}
                <a class="ch-button ch-blue info" data-id="{$vo.order_id}" href="javascript:;" title="查看">查看</a>
                <a class="ch-button ch-red tui" data-id="{$vo.order_id}" href="javascript:;" title="查看">退单</a>

                {/if}
                <!--{if condition="$vo.state == 6"}-->
                <!--<a style="text-decoration:none" class="ml-5 hui" data-id="{$vo.order_id}" href="javascript:;" title="回访"><span class="label label-success">回访</span></a>-->
                <!--<a style="text-decoration:none" class="ml-5 info" data-id="{$vo.order_id}"  href="javascript:;" title="查看"><span class="label label-default">查看</span></a>-->
                <!--&lt;!&ndash;<a style="text-decoration:none" class="ml-5 tui" data-id="{$vo.order_id}"  href="javascript:;" title="查看"><span class="label label-default">退单</span></a>&ndash;&gt;-->

                <!--{/if}-->
                {if condition="$vo.state == 7"}
                {if condition="$vo.yu != 0" }
                <a class="ch-button ch-green fa" data-id="{$vo.order_id}" href="javascript:;" title="发起验收">发起收款</a>
                {else}
                <a class="ch-button ch-green " data-id="{$vo.order_id}" href="javascript:;" title="发起验收">已结清</a>
                {/if}
                <?php if(empty($vo['product_id'])){?>
                <a class="ch-button ch-green hui" data-id="{$vo.order_id}" href="javascript:;" title="回访">回访</a>
                <a class="ch-button ch-blue info" data-id="{$vo.order_id}" href="javascript:;" title="查看">查看</a>
                <?php }else{ ?>
                <a class="ch-button ch-blue info" data-id="{$vo.order_id}" href="javascript:;" title="查看">查看</a>
                <?php } ?>


                <!--<a style="text-decoration:none" class="ml-5 tui" data-id="{$vo.order_id}"  href="javascript:;" title="查看"><span class="label label-default">退单</span></a>-->
                <!--<a style="text-decoration:none" class="ml-5 edit" data-id="{$vo.order_id}"  href="javascript:;" title="编辑"><span class="label label-default">编辑</span></a>-->
                {/if}
                {if condition="$vo.state == 9"}
                <?php if($vo['tui_state'] !=1){?>
                <a class="ch-button ch-green info" data-id="{$vo.order_id}" href="javascript:;" title="查看">已通过</a>
                <?php }else{?>
                <a class="ch-button ch-wathet shen" data-id="{$vo.order_id}" href="javascript:;" title="查看">审核</a>
                <a class="ch-button ch-greeninfo" data-id="{$vo.order_id}" href="javascript:;" title="查看">查看</a>
                <?php } ?>

                {/if}


                {if condition="$vo.state == 8"}
                <!--<a style="text-decoration:none" class="ml-5 edit " data-id="{$vo.order_id}" href="javascript:;" title="重新下单"><span class="label label-success">重新下单</span></a>-->
                <a class="ch-button ch-blue info" data-id="{$vo.order_id}" href="javascript:;" title="查看">查看</a>
                {/if}
                {if condition="$vo.state == 10"}

                <a class="ch-button ch-blue info" data-id="{$vo.order_id}" href="javascript:;" title="查看">查看</a>
                {/if}
            </div>
        </div>

        {/volist}

    </div>
<div class="pages" style="float: right">{$list->render()}</div>

    <div class="ch-more">
        <div class="ch-more-box">
            <div class="ch-more-top">
                <div class="ch-more-off"></div>
            </div>
            <div class="ch-more-tark">
                <div class="ch-more-content">
                    
                </div>
            </div>
        </div>
    </div>
</div>

{include file="public/footer"}
<script type="text/javascript">
    var $var = $('.states').val();
    if ($var != 0 && $var != 1) {
        $('#dig').text('预计上门时间')
    }

    function selecttime(flag) {
        if (flag == 1) {
            var endTime = $("#countTimeend").val();
            if (endTime != "") {
                WdatePicker({dateFmt: 'yyyy-MM-dd', maxDate: endTime})
            } else {
                WdatePicker({dateFmt: 'yyyy-MM-dd'})
            }
        } else {
            var startTime = $("#countTimestart").val();
            if (startTime != "") {
                WdatePicker({dateFmt: 'yyyy-MM-dd', minDate: startTime})
            } else {
                WdatePicker({dateFmt: 'yyyy-MM-dd'})
            }
        }
    }

    /**
     * 删除
     */
    $('.page-container').on('click','.del',function () {
        var winWidth = $(window).width();
        var areaWidth = "";
        var areaHeight = "";
        if( winWidth > 768 ){
            areaWidth = "400px"
            areaHeight = "400px"
        } else {
            areaWidth = '100%'
            areaHeight = '100%'
        }
        var id = $(this).attr('data-id');
        var src = "{:Url('index/order/del')}";
        layer.open({
            id: 1,
            type: 1,
            title: '确认取消原因',

            area: [areaWidth, areaHeight],

            content: ' <div class="s" id="chacha" style="width: 100%; margin-top:10px; display: flex; flex-direction: column; justify-content: center; padding-left: 10%">'
                + '<div class="checkbox ll"><label><input type="checkbox"  value="对益鸟不满意" aria-label="..." name="reas" class="reas">不做了</label></div>'
                + '<div class="checkbox ll"><label><input type="checkbox"  value="价格比其他家高" aria-label="..." name="reas" class="reas">价格比其他家高</label></div>'
                + '<div class="checkbox ll"><label><input type="checkbox"  value="价格比预期高" aria-label="..." name="reas" class="reas">价格比预期高</label></div>'
                + '<div class="checkbox ll"><label><input type="checkbox"  value="客户嫌麻烦" aria-label="..." name="reas" class="reas">客户嫌麻烦</label></div>'
                + '<div class="checkbox ll"><label><input type="checkbox"  value="超出业务范围" aria-label="..." name="reas" class="reas">超出业务范围</label></div>'
                + '<div class="checkbox ll"><label><input type="checkbox"  value="没有时间" aria-label="..." name="reas" class="reas">没有时间</label></div>'
                + '<div class="che"><textarea rows="3" cols="20" class="form-control" style=" width: 305px;height: 96px;" id="reason" placeholder="请输入其他原因"></textarea></div>' +
                '<div class="checkbox ll"><label><input type="checkbox"  value="其它" aria-label="..." name="reas" class="reas">其它</label></div>'

                + '</div>',
            btn: ['保存', '取消'],
            btn1: function (index, layero) {
                var arr = [];
                var s=arr;
                $("input[name='reas']:checkbox").each(function(index) {        if ($(this).prop("checked") === true) {
                    arr.push($(this).val());

                }
                });
                arr.join();
                if(arr.length>0){
                   s=1;
                }else {
                    s=2;
                }
                console.log(s);
                $.ajax({
                    type: 'POST',
                    url: src,
                    dataType: 'json',
                    data: {
                        order_id: id,
                        re:s,
                        arr:arr,
                        reason:$('#reason').val(),

                    },
                    success: function (data) {
                        var res = JSON.parse(data);
                        if (res.code == 200) {
                            layer.msg(res.msg, {icon: 1, time: 2000}, function () {
                                setTimeout("window.location.reload()", 1);
                            });
                        } else {
                            layer.msg(res.msg, {icon: 5, time: 1000});
                        }

                    },
                    error: function (data) {
                        console.log(data.msg);
                    },
                });

            },
            btn2: function (index, layero) {
                layer.close(index);
            }

        });
    });
    /**
     * 退单
     */
     $('.page-container').on('click','.tui',function () {
        var winWidth = $(window).width();
        var areaWidth = "";
        var areaHeight = "";
        if( winWidth > 768 ){
            areaWidth = "400px"
            areaHeight = "400px"
        } else {
            areaWidth = '100%'
            areaHeight = '100%'
        }
        var id = $(this).attr('data-id');
        var src = "{:Url('index/order/tui')}";
        layer.open({
            id: 1,
            type: 1,
            title: '退单',

            area: [areaWidth, areaHeight],

            content:`
            <div style="padding: 10px;">
                <div class="ch-row ch-info-form">
                    <p class="flex1">金额：</p>
                    <div class="flex2 ch-row">
                        <input type="text" class="form-control"  id="tui_moey" placeholder="请输入退单金额">
                        <input type="hidden" class="reasons"   value="">
                        </div>
                </div>
                <div class="ch-row ch-info-form">
                    <p class="flex1">原因：</p>
                    <div class="flex2">
                        <div style="margin-bottom: 10px;"><input type="checkbox" style="margin-right: 5px;" aria-label="..." value="对益鸟不满意" name="reas">对益鸟不满意</div>
                        <div style="margin-bottom: 10px;"><input type="checkbox" style="margin-right: 5px;" aria-label="..." value="觉得价格高了" name="reas" >觉得价格高了</div>
                        <div style="margin-bottom: 10px;"><input type="checkbox" style="margin-right: 5px;" aria-label="..." value="暂时不处理了" name="reas" >暂时不处理了</div>
                    </div>
                </div>
                <div class="ch-row ch-info-form"><div class="flex3 ch-row"><textarea rows="3" cols="20" class="form-control" style=" width: 305px;height: 96px;" id="reason" placeholder="请输入其他原因"></textarea></div></div>
            </div>`,
            btn:['保存','取消'],
            btn1: function (index,layero) {
                var arr = [];
                var s=arr;
                $("input[name='reas']:checkbox").each(function(index) {        if ($(this).prop("checked") === true) {
                    arr.push($(this).val());

                }
                });
                arr.join();
                if(arr.length>0){
                    s=1;
                }else {
                    s=2;
                }
                $.ajax({
                    type: 'POST',
                    url: src,
                    dataType: 'json',
                    data: {
                        order_id: id,
                        re:s,
                        arr:arr,
                        tui_moey: $('#tui_moey').val(),
                        reason: $('#reason').val(),

                    },
                    success: function (data) {
                        var res = JSON.parse(data);
                        if (res.code == 200) {
                            layer.msg(res.msg, {icon: 1, time: 2000}, function () {
                                setTimeout("window.location.reload()", 1);
                            });
                        } else {
                            layer.msg(res.msg, {icon: 5, time: 1000});
                        }

                    },
                    error: function (data) {
                        console.log(data.msg);
                    },
                });

            },
            btn2: function (index, layero) {
                layer.close(index);
            }

        });
    });
    /**
     * 详情
     */
    $('.page-container').on('click','.info',function () {
        var id = $(this).attr('data-id');
        var src = "{:Url('index/order/info')}";
        var index=layer.open({
            type: 2,
            area: ['100%', '100%'],
            fix: false,
            title: '订单详情',
            content: src + '?order_id=' + id
        });
        layer.full(index);
    });
    /**
     * 开工设置
     */
     $('.page-container').on('click','.she',function () {
        var winWidth = $(window).width();
        var areaWidth = "";
        var areaHeight = "";
        if( winWidth > 768 ){
            areaWidth = "500px"
            areaHeight = "300px"
        } else {
            areaWidth = '100%'
            areaHeight = '100%'
        }
        var id = $(this).attr('data-id');
        var src = "{:Url('index/order/she')}";
        layer.open({
            type: 2,
            area: [areaWidth, areaHeight],
            fix: false,
            maxmin: true,
            shade: 0.4,
            title: '开工设置',
            content: src + '?order_id=' + id
        });

    });
    /**
     * 发起验收
     */
     $('.page-container').on('click','.fa',function () {
        var winWidth = $(window).width();
        var areaWidth = "";
        var areaHeight = "";
        if( winWidth > 768 ){
            areaWidth = "500px"
            areaHeight = "500px"
        } else {
            areaWidth = '100%'
            areaHeight = '100%'
        }
        var id = $(this).attr('data-id');
        var src = "{:Url('index/order/she')}";
        layer.open({
            type: 2,
            area: [areaWidth, areaHeight],
            fix: true,
            maxmin: true,
            shade: 0.4,
            title: '发起验收',
            content: src + '?order_id=' + id
        });

    });
    /**
     * 确认订单
     */
    $('.page-container').on('click','.que',function () {
        var winWidth = $(window).width();
        var areaWidth = "";
        var areaHeight = "";
        if( winWidth > 768 ){
            areaWidth = "800px"
            areaHeight = "90%"
        } else {
            areaWidth = '100%'
            areaHeight = '100%'
        }
        var id = $(this).attr('data-id');
        var src = "{:Url('index/order/que')}";
        layer.open({
            type: 2,
            area: [areaWidth, areaHeight],
            fix: false,
            maxmin: true,
            shade: 0.4,
            title: '确认签约',
            content: src + '?order_id=' + id
        });
    });
    /**
     * 验收
     */
     $('.page-container').on('click','.yan',function () {
        var winWidth = $(window).width();
        var areaWidth = "";
        var areaHeight = "";
        if( winWidth > 768 ){
            areaWidth = "700px"
            areaHeight = "600px"
        } else {
            areaWidth = '100%'
            areaHeight = '100%'
        }
        var id = $(this).attr('data-id');
        var src = "{:Url('index/order/yan')}";
        layer.open({
            type: 2,
            area: [areaWidth, areaHeight],
            fix: false,
            maxmin: true,
            shade: 0.4,
            title: '开工设置',
            content: src + '?order_id=' + id
        });

    });
    /**
     * 编辑
     */
    $('.page-container').on('click','.edit',function () {
        var winWidth = $(window).width();
        var areaWidth = "";
        var areaHeight = "";
        if( winWidth > 768 ){
            areaWidth = "800px"
            areaHeight = "700px"
        } else {
            areaWidth = '100%'
            areaHeight = '100%'
        }
        var id = $(this).attr('data-id');
        var src = "{:Url('index/order/edit')}";
        layer.open({
            type: 2,
            area: [areaWidth,areaHeight],
            scrollbar: false ,//屏蔽浏览器滚动条
            shade: 0.4,
            title: '订单编辑',
            zIndex: layer.zIndex,
            content: src + '?order_id=' + id,
            success: function(layero, index) {
                layer.iframeAuto(index);
            }
        });
    });
    /**
     * 指派
     */
     $('.page-container').on('click','.zhi',function () {
        var id = $(this).attr('data-id');
        var key = $(this).attr('data-key');
        var src = "{:Url('index/order/zhi')}";
        layer.open({
            type: 2,
            area: ['100%', '100%'],
            scrollbar: false ,//屏蔽浏览器滚动条
            shade: 0.4,
            title: '订单指派',
            content: src + '?key='+key+'&order_id=' + id
        });
    });

    /***
     *
     * 接单提醒
     * */
    $('.page-container').on('click','.jie',function () {
        console.log(1)
        var message_d = $('.message').val();
        var assignor = $('.assignor').val();
        var order_id = $(this).attr('data-id');
        var src = "{:Url('index/order/jie')}";
        layer.confirm('确认要发送短信提醒吗？', function (index) {
            $.ajax({
                type: 'POST',
                url: src,
                dataType: 'json',
                data: {
                    order_id: order_id,

                },
                success: function (data) {
                    var res = JSON.parse(data);
                    if (res.code == 200) {
                        layer.msg(res.msg, {icon: 1, time: 2000}, function () {

                        });
                    } else {
                        layer.msg(res.msg, {icon: 5, time: 1000});
                    }

                },
                error: function (data) {
                    console.log(data.msg);
                },
            });
        });
    });

    /**
     * 基建列表
     */
     $('.page-container').on('click','.jilie',function () {
        var id = $(this).attr('data-id');
        var src = "{:Url('index/order/jilie')}";
        layer.open({
            type: 2,
            area: ['100%', '100%'],
            scrollbar: false ,//屏蔽浏览器滚动条
            shade: 0.4,
            title: '基建列表',
            content: src + '?order_id=' + id,
        });
    });
    /**
     * 回访
     */
    $('.page-container').on('click','.hui',function () {
        var winWidth = $(window).width();
        var areaWidth = "";
        var areaHeight = "";
        if( winWidth > 768 ){
            areaWidth = "769px"
            areaHeight = "600px"
        } else {
            areaWidth = '100%'
            areaHeight = '100%'
        }
        var id = $(this).attr('data-id');
        var src = "{:Url('index/order/hui')}";
        layer.open({
            type: 2,
            area: [areaWidth, areaHeight],
            fix: false,
            maxmin: true,
            shade: 0.4,
            title: '订单回访',
            content: src + '?order_id=' + id,

        });

    });

    /**
     * 审核
     */
     $('.page-container').on('click','.shen',function () {
         var winWidth = $(window).width();
         var areaWidth = "";
         var areaHeight = "";
         if( winWidth > 768 ){
             areaWidth = "300px";
             areaHeight = "200px";
         } else {
             areaWidth = '100%';
             areaHeight = '100%';
         }
        var order_id = $(this).attr('data-id');
        var src = "{:Url('index/order/shen')}";
        layer.open({
            id: 1,
            type: 1,
            title: '审核',

            area: [areaWidth, areaHeight],

            content: ' <div  id="chacha" >'
                + ' <textarea rows="3" cols="20"  id="tui_shen" style="width: 100%;height: 105px"></textarea>'
                + '</div>',
            btn: ['保存', '取消'],
            btn1: function (index, layero) {
                $.ajax({
                    type: 'POST',
                    url: src,
                    dataType: 'json',
                    data: {
                        order_id: order_id,
                        tui_shen: $('#tui_shen').val()
                    },
                    success: function (data) {
                        var res = JSON.parse(data);
                        if (res.code == 200) {
                            layer.msg(res.msg, {icon: 1, time: 2000}, function () {
                                setTimeout("window.location.reload()", 1);
                            });
                        } else {
                            layer.msg(res.msg, {icon: 5, time: 1000});
                        }

                    },
                    error: function (data) {
                        console.log(data.msg);
                    },
                });
            },
            btn2: function (index, layero) {
                layer.close(index);
            }

        });
    });

</script>
</body>
</html>
